package Logic;
import java.util.List;
import Exceptions.StrategoException;
import Logic.Objects.GameOptions;
import Logic.Objects.Move;
import Logic.Objects.Player;

public interface IPlayEngine{

    /*
     * Move player from (x1,y1) to (x2,y2), if occupied by other player's soldier then fight
     */
    public MoveResults move(int x1, int y1, int x2, int y2) throws StrategoException;
    public MoveResults move(Move move) throws StrategoException;
    
    /*
     * Return the Game option settings (AKA House rules)
     */
    public GameOptions getGameOptions();
    /*
     * Sets the Game option settings (AKA House rules)
     */
    public void setGameOptions(GameOptions gameOptions);
    
    /*
     * Set the board for specific width and height.
     * initialize the list of squares and randomly place water squares
     */
    public void setBoard(int width, int height) throws StrategoException;
    
    /* Returns the list of squares */
	public List<Square> getAllBoard() throws StrategoException;
	/* returns a specific square. 1<=x<=width and 1<=y<=height */ 
	public Square getBoardXY(int x, int y) throws StrategoException;
	/* sets a specific square. 1<=x<=width and 1<=y<=height */
	public boolean setBoardXY(Square square, int x, int y) throws StrategoException;
	public int getBoardWidth() throws StrategoException;
	public int getBoardHeight() throws StrategoException;
    /* Returns a 2D Array of the squares of the board as a specific player see them
     * At default he only see his own soldiers and other player's soldiers are of rank Unknown
     */
	public Square[][] getDisplayForPlayer(int playerId) throws StrategoException;
    
    public int getNumberOfPlayers() throws StrategoException;
    public void setNumberOfPlayers(int num) throws StrategoException;
    public int getCurrentPlayer(int playerId) throws StrategoException;
    public boolean isGameOver() throws StrategoException;
    public boolean[] getAlivePlayers() throws StrategoException; 
    public Player getPlayer(int i) throws StrategoException;
    
    public void clone(IPlayEngine src) throws StrategoException;   
    public void undo() throws StrategoException;
    public void redo() throws StrategoException;
	public String getPlayerName(int playerNum) throws StrategoException;
	public int getPlayerID(String playerName) throws StrategoException;
	public void setPlayerName(int playerNum, String name) throws StrategoException;
	public void setAIPlayer(int playerNum) throws StrategoException;
	public void setHumanPlayer(int playerNum) throws StrategoException;
	public List<MoveResults> getLastMovesForPlayer(int turns, int playerId);
	public List<MoveResults> getLastMoves(int turns);
	
	public void strSetMySoldiersRandomlly(String  playerName) throws StrategoException; 
	public void SetMySoldiersRandomlly(int PlayerNum) throws StrategoException ;
	public void clearLastMoves();
	public Object[] getCurrentPlayer_And_Display_And_LastMovesForPlayer(int turns, int playerId) throws StrategoException;
	public MoveResults playAI() throws StrategoException;
	public Player[] getAllPlayers();
	public void leaveGame(int playerId);
}
